package com.dingding.common.core.push.factory;

import com.dingding.common.core.push.pushmsg.PushData;
import com.dingding.common.core.util.DateFormatUtil;
import com.dingding.common.core.util.JSONUtil;

public class PushDataFactory {

	//获取当前时间的pushData
	public static PushData getCurrentPushData(String modular, Object object) {
		PushData pushData = new PushData();
		pushData.setModular(modular);
		pushData.setRequestNumber(DateFormatUtil.getTimeInMillis().toString());
		pushData.setRequestTime(DateFormatUtil.yyyy_MM_dd_HHmmss());
		pushData.setResponseBody(object);
		return pushData;
	}
	
	//获取当前时间的pushData（JSON形式）
	public static String getCurrentPushDataString(String modular, Object object){
		return JSONUtil.toJSONString(getCurrentPushData(modular, object));
	}
}
